#!/bin/sh

#this script compile and run the program.

compilationCommand="gcc *.c"
executionCommand="./a.out matriz*.txt"

x=a

echo "q: quit"
echo "anything else: compile and run again"
echo

while expr ${x}q != qq >/dev/null
do
	if ( $compilationCommand && echo "compilation ok" )
	then
		echo "running program"
		if ( $executionCommand )
		then
			echo "program ok"
		fi
	fi
	read x
done
